package com.itheima.d6_singleInstance;

import sun.awt.WindowIDProvider;

/**
 * 目标：掌握汉式单例的写法。
 */
public class Test1 {
    public static void main(String[] args) {
        // 目标：掌握单例设计模式的写法。
        //人一辈子就一个老婆，请设计一个老婆单例类  Wife

        //Wife wife1 = new Wife("柳岩",35);

        Wife myWife1 = Wife.getMyWife();
        Wife myWife2 = Wife.getMyWife();
        Wife myWife3 = Wife.getMyWife();
        System.out.println("myWife1 = " + myWife1);
        System.out.println("myWife2 = " + myWife2);
        System.out.println("myWife3 = " + myWife3);


    }
}
